{extend name="public/container"}

{block name="head_top"}

<link href="{__ADMIN_PATH__}plug/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="{__ADMIN_PATH__}plug/umeditor/third-party/jquery.min.js"></script>
<script type="text/javascript" src="{__ADMIN_PATH__}plug/umeditor/third-party/template.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH__}plug/umeditor/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH__}plug/umeditor/umeditor.js"></script>
<style>
    .wrapper-content {
        padding: 0 !important;
    }
</style>
{/block}
{block name="content"}
<div class="row">
   <div class="col-sm-12 panel panel-default" >
       <div class="panel-body" style="padding: 30px">
           <form class="layui-form" method="POST"  action="{:Url('admin/article.article/save')}">
             
               <div class="layui-form-item">
                <label class="layui-form-label">标题</label>
                <div class="layui-input-block">
                  <input type="text" name="title" required  value="{$detail?$detail.title:''}" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">作者</label>
                <div class="layui-input-block">
                  <input type="text" name="author" required  value="{$detail?$detail.author:''}" lay-verify="required" placeholder="请输入作者" autocomplete="off" class="layui-input">
                </div>
              </div>
              <input type="hidden" name="id" value="{$detail.id|default=0}">
              <div class="layui-form-item">
                <label class="layui-form-label">文章分类</label>
                <div class="layui-input-block">
                  <select name="cid" lay-verify="required">
                      {volist name="cate_list" key="key" id="vo"}
                            <option value="{$vo.id}" {if isset($detail) && $detail.cid == $vo.id }selected{/if}>{$vo.title}</option>
                      {/volist}
                  </select>
                </div>
              </div>
               <div class="layui-form-item">
                <label class="layui-form-label">图文封面</label>
                <div class="layui-input-block">
                    <a class="layui-btn" onClick="upload_img('image_input',{w:800,h:550})" type="button"><i class="layui-icon layui-icon-add-circle"></i>上传图片
                    </a>
                    <div class="albumList" id="albumList">
                        {if isset($detail) && $detail.image_input!=''}
                            <div class="album">
                                <img src="{$detail.image_input}" alt="图片" lay-src="{$detail.image_input}" data-tips-image>
                                <p class="layui-btn layui-btn-normal" style="display: block;" onclick="del_img(this)">删除</p>
                            </div>
                        {/if}
                    </div>
                </div>
                
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">文章简介</label>
                <div class="layui-input-block">
                    <textarea  id="synopsis" name="synopsis" class="layui-textarea" style="height:80px;resize:none;line-height:20px;color:#333;">{$detail.synopsis??''}</textarea>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">文章内容</label>
                <div class="layui-input-block">
                    <textarea  id="myEditor" name="content" class="layui-textarea" style="height:80px;resize:none;line-height:20px;color:#333;">{$detail.content??''}</textarea>
                </div>
            </div>
           


              <div class="layui-form-item">
                <label class="layui-form-label">是否显示热门</label>
                <div class="layui-input-block">
                  <input type="radio" name="is_hot" value="1" title="是"   {if isset($detail) && $detail['is_hot'] == 1}checked{/if}>
                  <input type="radio" name="is_hot" value="0" title="否"  {if isset($detail) && $detail['is_hot'] == 0}checked{/if}>
                </div>
              </div>
               <div class="layui-form-item">
                <label class="layui-form-label">原文链接</label>
                <div class="layui-input-block">
                  <input type="text" name="url" required  value="{$detail?$detail.url:''}" placeholder="选填，填写之后在图文左下方会出现此链接" autocomplete="off" class="layui-input">
                </div>
              </div>
               <div class="layui-form-item">
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit lay-filter="ajax_form_submit">立即提交</button>
                </div>
              </div>
           </form>
       </div>
   </div>
</div>
<script src="{__ADMIN_PATH__}js/layuiList.js"></script>
{include file="public/editor" /}
{/block}
